Integration Test on DB-Related Code with Docker Compose


  1. Download the executable from the official site and place it in the /usr/local/bin/.

    sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
    
  2. Grant the execution permission.

    sudo chmod +x /usr/local/bin/docker-compose
    
  3. Prepare dockerfile for test. e.g. pytest.Dockerfile

  4. Example docker compose config yaml (TODO)

  5. Build the related image first.

    docker-compose build
    
  6. Run the testing service.
    docker-compose run
    
  7. Remember to shut down all the services once finished.
    docker-compose down
    
  8. To check if there is any service from docker compose
    docker-compose ps
    






你可能感興趣的文章

ASP.NET Core Web API 入門教學 - 使用AutoMapper更新資料

ASP.NET Core Web API 入門教學 - 使用AutoMapper更新資料

將 ChatGPT LineBot 部屬在 Google Scripts 上

將 ChatGPT LineBot 部屬在 Google Scripts 上

F2E合作社|按鈕群組元件|Bootstrap 5網頁框架開發入門

F2E合作社|按鈕群組元件|Bootstrap 5網頁框架開發入門






留言討論